<!--这是首页顶部条Header组件-->
<template>
	<div class="header">
		<div class="header-left">
			<div class="iconfont header-back">&#xe637;</div>
		</div>
		<div class="header-input">
			<span class="iconfont">&#xe62b;</span>
			输入城市/景点/主题/游玩
		</div>
		<router-link to='/city'>
			<div class="header-right">
				{{this.city}}
				<span class="iconfont header-down">&#xe654;</span>
			</div>
		</router-link>

	</div>
</template>

<script>
	import { mapState } from 'vuex'
	export default{
		name:'HomeHeader',
		computed:{
			...mapState(['city'])
		}
	}
</script>

<!--lang=“stylus”是一个CSS格式化插件，scoped表示只对当前组件有效-->
<style lang="stylus" scoped>
	/*引入了varibles.styl文件,是CSS变量*/
	@import '~styles/varibles.styl'

	.header
		display:flex
		height:$headerHeight
		background:$bgColor
		color:#fff
		line-height:$headerHeight
		/*min-width:6rem*/
		.header-left
			width:.8rem
			float:left
			.header-back
				font-size:.5rem
				text-align:center
		.header-input
			flex:1
			height:.64rem
			line-height:.64rem
			margin:auto
			background-color:#fff
			color:#ccc
			border-radius:.1rem
			padding-left:.2rem
		.header-right
			min-width:1.04rem
			padding:0 .1rem
			float:right
			text-align:center
			color:#fff
			.header-down
				font-size:.3rem
				margin-left:-.05rem
</style>